import MysqlServer from "../utils/connect";
import {ISqlInsert} from "../../global";


export interface IExpert {
    expertUID: string
    userUID: string
    expertName: string
    expertID: string
    expertWx: string
    expertSendSample: string
    expertAddress: string
    expertCode: string
}

export const expertList = async (params: Array<string>): Promise<Array<IExpert>> => {
    return await MysqlServer.sqlAsync<Array<IExpert>, Array<string>>('SELECT * FROM t_expert WHERE userUID = ?', params)
}

export const expertAddDao = async (params: Array<string>): Promise<ISqlInsert> => {
    return await MysqlServer.sqlAsync<ISqlInsert, Array<string>>('INSERT INTO t_expert(`expertUID`, `userUID`, `expertName`, `expertID`, `expertWx`, `expertSendSample`, `expertAddress`, `expertCode`) VALUES(?, ?, ?, ?, ?, ?, ?, ?)', params)
}